<?php

/*
Add Trivia Games (admin_add_trivia_question.php)
*/

$page_title = "Add Trivia Question";
$rank_check = 7;
include "../header.inc.php";

print "$openHTML";

$find_games = mysql_query("SELECT id,gamename FROM trivia_games WHERE game = '$game'");

while ($get_games = mysql_fetch_array($find_games))
{
	$id = $get_games[id];
	if ($get_games[id] == $trivia)
	{
		$select[$id] = " SELECTED";
	}
	$list_games .= "<option value=$get_games[id]$select[$id]>$get_games[gamename]";
}

ECHO <<<END

<P>To add a question, enter a question and two, three or four possible answers, indicating which one is correct by clicking the bubble next to it. Make sure that you are adding to the correct game, in the menu at the bottom of the form. If you do not have any trivia games created, click <a href=admin_add_trivia_game.php?game=$game>here</a>.</P>

<FORM ACTION="admin_add_trivia_q.pro.php?game=$game" METHOD=POST> <CENTER><TABLE BGCOLOR="$tableOutline"
CELLSPACING=1 CELLPADDING=0 WIDTH=98%>

<TR BGCOLOR="$topAndBottomBG"> <TD COLSPAN=2 HEIGHT=50>
<CENTER><FONT SIZE="+2" COLOR="$topAndBottomText">--Add Trivia Question--</FONT></CENTER> </TD> </TR>

<TR
BGCOLOR="#FFFFFF"> <TD WIDTH=128 HEIGHT=40> <P>Question:</P> </TD> <TD HEIGHT=40>
<P><FONT SIZE="-1">&nbsp;<INPUT TYPE=text NAME="add_question" VALUE="" SIZE=43
MAXLENGTH=255></FONT></P> </TD> </TR>

<TR BGCOLOR="$reallyLight"> <TD WIDTH=128 HEIGHT=40>
<P>Answer A</P> </TD> <TD HEIGHT=40> <P><FONT SIZE="-1">&nbsp;<INPUT TYPE=text
NAME="answer1" VALUE="" SIZE=43 MAXLENGTH=128><input type=radio name=answer value=1></FONT></P> </TD> </TR>

<TR
BGCOLOR="#FFFFFF"> <TD WIDTH=128 HEIGHT=40> <P>Answer B</P> </TD> <TD HEIGHT=40>
<P><FONT SIZE="-1">&nbsp;<INPUT TYPE=text NAME="answer2" VALUE="" SIZE=43
MAXLENGTH=128><input type=radio name=answer value=2></FONT></P> </TD> </TR>

<TR BGCOLOR="$reallyLight"> <TD WIDTH=128 HEIGHT=40>
<P>Answer C</P> </TD> <TD HEIGHT=40> <P><FONT SIZE="-1">&nbsp;<INPUT TYPE=text
NAME="answer3" VALUE="" SIZE=43 MAXLENGTH=128><input type=radio name=answer value=3></FONT></P> </TD> </TR>

<TR
BGCOLOR="#FFFFFF"> <TD WIDTH=128 HEIGHT=40> <P>Answer D</P> </TD> <TD HEIGHT=40>
<P><FONT SIZE="-1">&nbsp;<INPUT TYPE=text NAME="answer4" VALUE="" SIZE=43
MAXLENGTH=128><input type=radio name=answer value=4></FONT></P> </TD> </TR>

<TR BGCOLOR="$reallyLight"> <TD WIDTH=128 HEIGHT=40>
<P>Trivia Game:</P> </TD> <TD HEIGHT=40> <P><FONT SIZE="-1">&nbsp;<SELECT NAME=trivia_game>$list_games</SELECT></FONT></P> </TD> </TR>

<TR> <TD
COLSPAN=2 HEIGHT=30 BGCOLOR="$topAndBottomBG"> <CENTER><FONT SIZE="-1" COLOR="$topAndBottomText"><I><INPUT
TYPE=submit NAME=Submit VALUE="Add Trivia Game!!"></I></FONT></CENTER> </TD> </TR> </TABLE>
</CENTER> </FORM>

END;

print "$closeHTML";
?>
